(function (B) {
    B.namespace("gh.app.globalkeyboardshortcuts");
    var A = gh.app.globalkeyboardshortcuts;
    A.findSelectedIssueId = function () {
        var C;
        if (jira && jira.app && jira.app.issuenavigator && jira.app.issuenavigator.getSelectedIssueId) {
            C = jira.app.issuenavigator.getSelectedIssueId()
        }
        if (!C && jira && jira.app && jira.app.issue && jira.app.issue.getIssueId) {
            C = jira.app.issue.getIssueId()
        }
        return C
    };
    A.goToPlanningBoard = function () {
        A.goToBoard("PlanningBoard", "#planningboard-mlink")
    };
    A.goToTaskBoard = function () {
        A.goToBoard("TaskBoard", "#taskboard-mlink")
    };
    A.goToBoard = function (C, F) {
        var E = A.findSelectedIssueId();
        if (E && contextPath) {
            var D = contextPath + "/secure/GetBoardForIssue2.jspa?pageType=" + C + "&issueId=" + E;
            AJS.reloadViaWindowLocation(D)
        } else {
            A.followLink(F)
        }
    };
    A.followLink = function (C) {
        var D = B(C);
        if (D.length > 0 && (D.attr("nodeName").toLowerCase() === "a" || D.attr("nodeName").toLowerCase() === "link")) {
            D.click();
            window.location.href = D.attr("href")
        }
    }
})(AJS.$);